import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop022_删除商品品牌"
# 1.点击添加品牌按钮，品牌名称“苹果”。
# 打开网址
firefox=openBrowser(urlAdmin)
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品品牌')
firefox.find_element_by_xpath('//td[contains(.,"我是真爱粉")]/following-sibling::td[4]/a[2]').click()
firefox.switch_to.alert.accept()
time.sleep(3)
#断言
try:
    firefox.find_element_by_xpath("//td[contains(.,'我是真爱粉')]")
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()